import { Component } from '@angular/core';
import {HttpClient, HttpHeaders} from "@angular/common/http";

@Component({
  selector: 'app-user-login',
  templateUrl: './user-login.component.html',
  styleUrls: ['./user-login.component.css']
})
export class UserLoginComponent {
  private url_login = "http://localhost:8080/user/login";
  constructor(public http:HttpClient) {}
  userInfo = {
    username: '',
    password: '',
    email: '',
    phone: ''
  }

  login(){
    const httpOptions={
      headers: new HttpHeaders({'Content-Type':'application/json'})
    };
    this.http.post(this.url_login,
      this.userInfo, httpOptions)
      .subscribe((response:any)=>{
        alert(response.message)
      })
  }

}
